<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
 <?php if ($products) { ?>
  <div class="product-filter">
  <?php /* ?>
    <div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a></div>
	<?php */ ?>
    <div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
    <div class="sort"><b><?php echo $text_sort; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  </div>
  
  <div class="product-list">
    
	<?php foreach ($products as $product) { ?>
    
    <div>
    	
      <div class="left">
      
		  <?php if ($product['thumb']) { ?>
          <div class="image <?php if ($product['top']) echo 'topproduct'; ?>"><a href="<?php echo $product['href']; ?>">
          	<img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
            </a>
          </div>
          <?php } ?>
          
          <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
          
          <div class="description"><?php echo $product['subname']; ?></div>
          
          <div class="serving"><?php echo $product['opis']; ?></div>
          <div class="serving">кат.№:<?php echo $product['model']; ?></div>
		  <?php if ($product['price']) { ?>
          <div class="price">
            
			<?php if (!$product['special']) { ?>
            	<?php echo $product['price']; ?>
            <?php } else { ?>
            
            <span class="price-old"><?php echo $product['price']; ?></span> 
            <span class="price-new"><?php echo $product['special']; ?></span>
            
			<?php } ?>
            
            <?php if ($product['tax']) { ?>
            <br />
            <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
            <?php } ?>
            
          </div>
          
			  <?php if ($product['discounts']) { 
              $dcount = 1;
              ?>
              <div class="bulk">
              <?php
              foreach ($product['discounts'] as $discount) { ?>
              
                  <a onclick="addToCart('<?php echo $product['product_id']; ?>', '<?php  echo $discount['quantity'];?>');">
                  Купи <?php  echo $discount['quantity'];?> за <?php  echo $discount['total']; ?> 
                  </a>
             
                  <?php 
                  $dcount ++;
                  } 
                    ?>
              </div>
              <?php
                } ?>
          
          <?php } ?>
          
		  <?php if ($product['rating']) { ?>
          <div class="rating">
          	<img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
          </div>
          <?php } ?>
      
      </div>
      
      <div class="right">
          
          <div class="cart">
            <a title="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" ></a>
          </div>
          <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
          <?php /* ?>
          <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>
          <?php */ ?>
      </div>
      
    </div>
    <?php } ?>
  </div>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } else { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <?php }?>
  </div><?php echo $content_bottom; ?>

<?php echo $footer; ?>